import json
import pytest
import requests
from jsonpath import jsonpath

from tools.read_Excel import read_data
from tools.read_pathlib import exc_path
from tools.handle_assert import handle_assert
from tools.handle_requests import requests_api
search_cartcase = read_data(exc_path=exc_path,sheetname="搜索")


@pytest.mark.parametrize("data",search_cartcase)
def test02_search_cart(data):
    search_res = requests_api(data)
    handle_assert(search_res,data["预期结果"])
